using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;

namespace Tests
{
    public class UIPlayerInfo : MonoBehaviour
    {
        [SerializeField]
        private TMP_Text nameText;
        [SerializeField]
        private TMP_Text levelText;
        // [SerializeField]
        // private Image avatarImage;
        private Models.PlayerModel _playerModel;

        void Start()
        {
            _playerModel = ModelManager.GetModel<Models.PlayerModel>();

            // 刷新界面
            RefreshUI();
        }

        void RefreshUI()
        {
            // 刷新界面
            nameText.text = _playerModel.Name;
            levelText.text = _playerModel.Level;
            // avatarImage.sprite = _playerModel.Avatar;
        }


    }
}
